<?php

class MessageLogistics{
	
	const PASSWORD_MISMATCH = 0;
	const USERNAME_EXISTS = 1;
	const INCORRECT_PASSWOD_LENGTH = 2;
	const MISSING_FORM_VALUES = 3;
	const EMAIL_MISMATCH = 4;
	const REGISTER_SUCCESS = 5;
	

	
	function Messages($i = NULL, $field = NULL)
	{
		switch($i)
		{
			case self::PASSWORD_MISMATCH:
	       		return "<div class='error'> Passwords does not match! </div>";
	        	break;
	        	
	        case self::USERNAME_EXISTS:
	       		return "<div class='error'> Username allready exists </div>";
	        	break;

	        case self::INCORRECT_PASSWOD_LENGTH:
	       		return "<div class='error'> Password has to be atleast 6 characters long! </div>";
	        	break;

	        case self::MISSING_FORM_VALUES:
	       		return "<div class='error'>All fields has to be filled!</div>";
	        	break;

	        case self::EMAIL_MISMATCH:
	       		return "<div class='error'>Email does not match!</div>";
	        	break;

	        case self::REGISTER_SUCCESS:
	       		return "<div class='success'>You have been registred</div>";
	        	break;
	       
		}
	}
	
	function LoginMessages($i = NULL, $field = NULL)
	{
		switch($i)
		{
			case self::LOGGED_OUT:
	       		return "<div class='success'> Logged out </div>";
	        	break;
	        	
	        case self::SUCCESS_LOGIN:
	       		return "<div class='success'> Logged in </div>";
	        	break;

	        case self::FAIL_LOGIN:
	       		return "<div class='error'> The login proccess failed</div>";
	        	break;

	        case self::INVALID_PASSWORD:
	       		return "<div class='error'> Invalid login password</div>";
	        	break;

	        case self::INVALID_USERNAME:
	       		return "<div class='error'> Invalid login username</div>";
	        	break;
	       
		}
	}
}